home *** CD-ROM | disk | FTP | other *** search
- README for Example.EXE 02/02/92
- Copyright 1992 by L.J. Johnson
- All rights reserved
-
- This code is NOT released into the public domain. However, I
- have no desire for any reimbursement. If you find the code
- useful, a simple "thanks" in the printed documentation is quite
- sufficient.
-
- =================================================================
-
- A couple of points about the program. It is designed to work on
- Novell 3.x networks, and I have no idea if it works on Novell 2.x
- (I have no way to test it). It is also designed to work with
- Novell DLL's versions 1.2.2.0 and above. It you want to try it
- with earlier versions, you will have to modify the code in
- MainForm so it will not abort the program.
-
- The emphasis on this example program is for people working with
- multiple servers. If you only have one server on your network,
- then a good portion of the code will not be of much help to you.
- The MapDrive section will still work, however.
-
- I do not have much experience with Novell programming, but based
- upon knowledge of other systems, I would suggest taking their
- strongly-worded warning to heart. It is very good defensive
- programming to always check the versions of the DLL's you are
- going to use. It is always much better to abort the program with
- a good error message than to continue and possibly crash very
- inelegantly.
-
- One very confusing point (at least to me) was the functions
- AttachToFileServer and LoginToFileServer. In this context,
- "Attach" and "Login" do not mean what they do with the Novell DOS
- utilities LOGIN and ATTACH. Both of these DOS utilities do, from
- the viewpoint of the Novell DLL's, two separate tasks --
- AttachToFileServer and LoginToFileServer. AttachToFileServer
- attaches the workstation to a fileserver, and gets a ConnectionID
- in return. The LoginToFileServer completes the task by passing
- the user's name, type, and password to the server.
-
- There are 3 connection priorities for workstation requests:
- preferred server, default server, and primary server. When you
- set a preferred server from within your program, ALL requests are
- routed to that server. If you are on one server, attach to
- another server, but try to Login to that server without setting
- the preferred server, you will re-login to your current server
- (almost guaranteed to produce a spectacular crash if that is your
- primary server). If there is no preferred server, then requests
- are sent to the default server -- ie, the one implied by the
- default drive. If the default drive is a local drive, then the
- lowest priority (primary server) takes effect. The primary
- server is the one you originally did the LOGIN to (not any
- servers you have attached to later). Obviously, the safest
- course is to always set the preferred server before making any
- server requests. Then you will always be sure where the messages
- are going.
-
- Another confusing point is the Connection ID and the Connection
- Number. It is all too easy when writing the program to
- inadvertently substitute one for the other, and create some
- really nifty bugs. The Connection ID is one of the 8 possible
- servers to which a workstation can be attached. The Connection
- Number, on the other hand, is a unique number the server gives to
- the workstation gives to the workstation when the connection is
- made.
-
- Notice that there are no labels in any of the forms. It makes it
- slightly harder on the programmer at design time, but it saves
- enough of your precious system resources to make this small
- sacrifice worthwhile.
-
- Notice also that I set up 5 global variables in my Global file.
- I have argued with structured programming gurus over the last few
- years about issues like this, and I have concluded that while I
- agree with most of the concepts of structured programming, I
- reserve the right to take exceptions where I feel that they are
- needed. I also sometimes exit a sub in more than one place, if I
- feel that it is more logical and straightforward (and readable)
- than the alternative control structures. I even use GOTOs
- sometimes (although not in this particular program) when I feel
- it makes sense to do so, and I do not apologize for any of these
- structured programming "errors".
-
- MapDrive is used in this program to map regular drives. You can
- also use it to make search drives.
-
- I hope this code makes someone else's life a little easier, and
- saves some of the trial and tribulation I experienced when trying
- to get it to work in my first program.
-